﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KELT.KELTObjects.ChartObjectModel
{
    public class TimebarObj
    {
        private string m_title = null;
        private int m_startTime = 0;
        private int m_endTime = 1;
        private int m_duration = 1;

        public string title
        {
            get
            {
                if (m_title == null)
                    return "no title";
                else
                    return m_title;
            }
            set
            {
                m_title = value;
            }
        }
        public int startTime
        {
            get
            {
                return m_startTime;
            }

            set
            {
                m_startTime = value;
            }
        }
        public int endTime
        {
            get
            {
                return m_endTime;
            }

            set
            {
                if(m_startTime > value)
                {
                    m_endTime = m_startTime;
                    m_startTime = value;
                }
                else
                {
                    m_endTime = value;
                }
            }
        }
        public int durationTime
        {
            get
            {
                m_duration = m_endTime - m_startTime;
                return m_startTime;
            }
        }
    }
}
